package com.sixth.volunteerservicesystem.Controller.ExamController.backExam;

import com.sixth.volunteerservicesystem.Dao.QuestionRepository;
import com.sixth.volunteerservicesystem.domain.Subjects;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;


import java.util.ArrayList;
import java.util.List;
import java.util.Optional;


/**
 * @author Steve Jobs
 * @create 2021-01-11 12:41
 */
@Controller
public class UpdateSubjects {

    @Autowired
    QuestionRepository questionRepository;


    @RequestMapping("/updateSubjects/{id}")
    public String updateSubjects(@PathVariable("id") Integer id, Model model){

        Subjects subject = null;

        subject = questionRepository.findById(id).get();

        model.addAttribute("subject",subject);
        return "backstageExam/updateSubjects";
    }
}
